const seq = require('sequelize')
const time = require('../time');
module.exports = {
  NAME: 'sys_menu',
  TABLE: {
    menu_id: {
      type: seq.INTEGER(19),
      primaryKey: true,
      unique: true,
      autoIncrement: true,
      allowNull: false,
      comment: 'menu_id 主键，自增',
      field: 'menu_id', //  相应的字段名称
    },
    menu_name: {
      type: seq.STRING(30),
      comment: '菜单名称',
      field: 'menu_name',
      defaultValue: ''
    },
    parent_id:{
      type: seq.INTEGER(19),
      allowNull: false,
      comment: '父菜单id',
      field: 'parent_id', //  相应的字段名称
      defaultValue: 0
    },
    order_num: {
      type: seq.INTEGER(),
      comment: '显示顺序',
      field: 'order_num',
      defaultValue: 0
    },
    path: {
      type: seq.STRING(200),
      comment: '路由地址',
      field: 'path',
      defaultValue: ''
    },
    component: {
      type: seq.STRING(200),
      comment: '组件路径',
      field: 'component',
      defaultValue: ''
    },
    query:{
      type: seq.STRING(255),
      comment: '路由参数',
      field: 'query',
      defaultValue: ''
    },
    is_frame:{
      type: seq.INTEGER(1),
      comment: '是否为外链（0是 1否）',
      field: 'is_frame',
      defaultValue: 0
    },
    is_cache:{
      type: seq.INTEGER(1),
      comment: '是否缓存（0缓存 1不缓存）',
      field: 'is_cache',
      defaultValue: 0
    },
    menu_type:{
      type: seq.CHAR(1),
      comment: '菜单类型（M目录 C菜单 F按钮）',
      field: 'menu_type',
      defaultValue: 'M'
    },
    visible:{
      type: seq.CHAR(1),
      comment: '菜单状态（1显示 0隐藏）',
      field: 'visible',
      defaultValue: '1'
    },
    status:{
      type: seq.CHAR(1),
      allowNull: false,
      comment: '菜单状态（1正常 0停用）',
      field: 'status',
      defaultValue: '1'
    },
    perms:{
      type: seq.STRING(100),
      comment: '权限标识',
      field: 'perms',
      defaultValue: ''
    },
    icon:{
      type: seq.STRING(100),
      comment: '菜单图标',
      field: 'icon',
      defaultValue: ''
    },
    remark: {
      type: seq.STRING(500),
      comment: '备注',
      field: 'remark',
      defaultValue: ''
    },
    del_flag:{
      type: seq.CHAR(1),
      comment: '删除标志（0代表存在 2代表删除）',
      field: 'del_flag',
      defaultValue: '0'
    },
    ...time.create_date,
    ...time.update_date,
    ...time.create_by,
    ...time.update_by,
  },
}
